package cn.iocoder.yudao.module.erp.controller.admin.marketcontract.vo;

import cn.iocoder.yudao.framework.mybatis.core.type.StringListTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.math.BigDecimal;
import java.util.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 市场管理合同信息新增/修改 Request VO")
@Data
public class ErpMarketContractSaveReqVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "合同名称")
    @NotEmpty(message = "合同名称不能为空")
    private String contractName;

    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同编号不能为空")
    private String contractNo;

    @Schema(description = "乙方名称（供应商）", requiredMode = Schema.RequiredMode.REQUIRED, example = "供应商")
    @NotEmpty(message = "乙方名称（供应商）不能为空")
    private String partyB;

    @Schema(description = "签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "签订时间不能为空")
    private LocalDateTime signingDate;

    @Schema(description = "终止日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "终止日期不能为空")
    private LocalDateTime expirationDate;

    @Schema(description = "生效日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "生效日期不能为空")
    private LocalDateTime effectiveDate;

    @Schema(description = "摘要内容")
    private String contractSummary;

    @Schema(description = "合同责任人", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同责任人不能为空")
    private String contractPerson;

    @Schema(description = "文件")
    @TableField(typeHandler = StringListTypeHandler.class)
    private List<String> contractFile;

    @Schema(description = "版本备注", example = "随便")
    private String remark;

    @Schema(description = "产品清单列表")
    private List<ProductItem> items;

    @Data
    @Schema(description = "订单清单列表 Item")
    public static class ProductItem {

        @Schema(description = "订单项编号", example = "11756")
        private Long id;

        @Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
        @NotNull(message = "产品编号不能为空")
        private Long productId;

        @Schema(description = "产品价格")
        @NotNull(message = "产品价格不能为空")
        private BigDecimal price;

        @Schema(description = "终止日期", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "终止日期不能为空")
        private LocalDateTime productExpirationDate;

        @Schema(description = "生效日期", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "生效日期不能为空")
        private LocalDateTime productEffectiveDate;

    }



}
